var page = sm("do_Page");
var nf = sm("do_Notification");
var imHelper = require("helper/im");

var rootView = ui("$");
rootView.setMapping({
	"lableName.tag":"id",	
	"lableName.text":"name",
	"do_ALayout_Pic.tag" : "imgItems",//新版图片集合
	"do_ALayout_line.tag" : "memberCount"
});

var gridLogo4 = ui("gridLogo4");
var gridLogo6 = ui("gridLogo6");
var gridLogo9 = ui("gridLogo9");
rootView.on("dataRefreshed", function(){
	var memberCount = ui("do_ALayout_line").tag;
	var imgItems = JSON.parse(ui("do_ALayout_Pic").tag);
	if(memberCount<=4){
		gridLogo4.visible = true;
		gridLogo4.items = imgItems;
		gridLogo6.visible = false;
		gridLogo9.visible = false;
	}else if(memberCount<=6){
		gridLogo6.visible = true;
		gridLogo6.items = imgItems;
		gridLogo4.visible = false;
		gridLogo9.visible = false;
	}else{
		gridLogo9.visible = true;
		gridLogo9.items = imgItems;
		gridLogo4.visible = false;
		gridLogo6.visible = false;
	}
});

rootView.on("touch","", 3000,function(){
	var groupId = ui("lableName").tag;//群组id
	if(groupId!=null){
		imHelper.toGroupChat(groupId);//到他的主页
	}
})
